<?php
ob_start();


//Allows us to use cookies on all of the pages

/*
iSuS - iScripting.net User System
v1.0 made by Panzer
http://www.iScripting.net
Copyright must stay intact
*/
$siteurl = "http://localhost/r2cms"; 
$location = getcwd();

$installDir = 'C:/wamp/www/r2cms';
$scriptsDir = "$installDir/scripts";
$themesDir = "$installDir/themes";
$staticDir = "$installDir/static";
$sourceDir = "$installDir/sources";

$path = dirname(__FILE__).'/';

function location(){

echo $location;

}

location();


//Get some additional functions
include('functions.php');
include('sources/func_auth.php');
include('sources/func_settings.php');
include('sources/func_theme.php');



//*********************************************//
//Length Of Time Cookie Lasts - 1 week default
$cookieTime = time()+7*86400;
//***********************************************//
//Define The Salt
//define('SALT', 'kiukhithere'); //Example k483hl2948hHe73

//Path to index.php file , no following slash
//Eg, if the index file were located at http://iscripting.net/isus/index.php - you would enter http://iscripting.net/isus

//Your Website name, not the <title>
//$sitename = "ProBlog";

//The default membergroup when someone registers.
//$defaultmembergroup = "user";

//Database information
$db_user = 'root';
$db_pass = '';
$db_host = 'localhost';
$db_database = 'blog';
//**********************************************//


//Connect to the database
$connect = mysql_connect("$db_host","$db_user","$db_pass");

if (!$connect ) echo 'There was an error connecting to the database';

mysql_select_db("$db_database");

$pathToStyleSheet= "themes/" . currentTheme() . "/style.css";


$nav = $_GET['action'];
secure($nav);
// Get and authenticate their cookie information.
$u1 = secure($_COOKIE['username']);
$p1 = secure($_COOKIE['password']);

//Check theyre logged in.
$logged = mysql_query("SELECT * FROM users WHERE username = '$u1' AND password = '$p1'");

$logged = mysql_fetch_array($logged, MYSQL_ASSOC);

//Rename some of the $logged['variables'] with easier names.
$uId = $logged['id'];
$uName = $logged['username'];
$uEmail = $logged['email'];
$uMsn = $logged['msn'];
$uIp = $logged['ip'];
$uSignup = $logged['signup'];
$uLevel = $logged['level'];
$uGtalk = $logged['gtalk'];
$uMsn = $logged['msn'];
$uAim = $logged['aim'];
$uLocation = $logged['location'];
$uBio = $logged['bio'];
$uGroup = $logged['gid'];
$uMembergroup = $logged['membergroup'];

//If the user isn't logged in, we'll set their name to guest and membergroup to guest as well so they don't screw anything up
if (!$uName) {

$uName = guest;
$uMembergroup = guest;

}

//Get the permissions sorted out.
$permquery1 = mysql_query("SELECT * FROM `permissions` WHERE mg_name = '$uMembergroup' ");
$userCan = mysql_fetch_assoc($permquery1);



$action = secure($_GET['action']);
$sa = secure($_GET['sa']);
$ssa = secure($_GET['ssa']);


?>